﻿
namespace MetaVideoEditorEvolved.ViewModel
{
	using System;
	using GalaSoft.MvvmLight;
	using System.Linq;

	public class AboutWindowVM : ViewModelBase
	{
		string releaseType;
		
		public string ReleaseType
		{
			get
			{
				return releaseType;
			}
			
			set
			{
				releaseType = value;
				this.RaisePropertyChanged("ReleaseType");
			}
		}
		
		Version currentVersion;
		
		public Version CurrentVersion
		{
			get
			{
				return currentVersion;
			}
			
			set
			{
				currentVersion = value;
				this.RaisePropertyChanged("CurrentVersion");
			}
		}
		
		public AboutWindowVM()
		{
			this.currentVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
			
			var config = System.Reflection.Assembly.GetExecutingAssembly().GetCustomAttributes(true).First((att)=>
			                                                                                               {
			                                                                                               	return att is System.Reflection.AssemblyConfigurationAttribute;
			                                                                                               }) as System.Reflection.AssemblyConfigurationAttribute;
			
			this.releaseType = config.Configuration;
		}
	}
}
